package 力扣日常刷题.木22一月.第17天0129;

/**
 * @author 帅小伙
 * @date 2022/1/29
 * @description
 */
public class Demo26数组简单好数对的数目 {



    public int numIdenticalPairs(int[] nums) {
        int ans = 0;
        for (int i = 0; i < nums.length; i++) {
            for (int j = i+1; j < nums.length; j++) {
                if(nums[i] == nums[j]) ans++;
            }
        }
        return ans;
    }

}
